package tech.aistar.pojo;


import lombok.*;

import java.io.Serializable;

@Data
@AllArgsConstructor
@NoArgsConstructor
@RequiredArgsConstructor
public class ResultReturn<T> implements Serializable {
    @NonNull
    private String location;

    @NonNull
    private String msg;

    private T data;

    public  static <T> ResultReturn<T> success(T data) {
        return new ResultReturn<T>("200","查询成功",data);
    }
    public static <T> ResultReturn<T> fail(String msg) {
        return new ResultReturn<T>("500",msg);
    }
}
